home *** CD-ROM | disk | FTP | other *** search
- /*
- File: UTIL.h
-
- Contains: Constant and structure definitions for the LaserWriter Font Utility UTILs.
-
- Written by: Bryan K. Ressler (Beaker)
-
- Copyright: © 1988-1991 by Apple Computer, Inc., all rights reserved.
- */
-
- /* --- Return codes ------------------------------------------------------------------- */
- #define urNoAction 0x00000000 /* No action by the LWFU is required */
- #define urCheckDriver 0x00000001 /* Recheck the currently selected printer driver */
- #define urCheckPrinter 0x00000002 /* Recheck the currently selected printer */
- #define urCheckFeatures 0x00000004 /* Recheck features of currently selected printer */
- #define urEraseLists 0x00000008 /* Erase all fonts lists */
- #define urWaitOnPrinter 0x40000000 /* Wait for the printer to become ready */
- #define urError 0x80000000 /* The Prime routine encountered an error */
-
- /* --- EOF codes for DoWrite ---------------------------------------------------------- */
- #define sendEOF 1 /* send EOF to the LaserWriter, after the data */
- #define dontSendEOF 0
-
- /* --- Printer classes ---------------------------------------------------------------- */
- #define classA 0 /* for the printerClass field of LWFUPrinterInfo */
- #define classB 1
- #define classC 2
-
- /* --- Error return values ------------------------------------------------------------ */
- #define printerError 1000 /* OpenPrinter couldn't open the printer */
-
- /* --- Structure definitions ---------------------------------------------------------- */
- typedef struct {
- FSSpec theDriver; /* File spec of the current driver */
- Boolean driverHasTrueType; /* True if the driver understands TrueType */
- } LWFUDriverInfo;
-
- typedef struct {
- char *currentPrinterName; /* Name of the current printer (Pascal) */
- THPrint printRecord; /* LWFU’s print record */
- Boolean printerHasCartridge; /* True if the current printer has a cartridge */
- Boolean diskPresent; /* True if a disk is attached to the printer */
- Boolean diskInitialized; /* True if the disk is initialized */
- Boolean mayHaveDisk; /* True if we may have a disk but we’re not sure */
- Boolean distinguishesDisks; /* True if the individual disks are accessible */
- Boolean hasCompFonts; /* True if the printer does composite fonts */
- Boolean scalerPresent; /* True if the TrueType scaler is present in VM */
- Boolean sysStartPatched; /* True if the Sys/Start file has been patched */
- short printerClass; /* Either classA, classB, or classC */
- short printerDisksPresent; /* Disks available - SCSI 0 is bit 0, etc. */
- } LWFUPrinterInfo;
-
- typedef struct {
- char privates[76]; /* Quickdraw private stuff */
- long randSeed; /* The usual Quickdraw globals */
- BitMap screenBits;
- Cursor arrow;
- Pattern dkGray;
- Pattern ltGray;
- Pattern gray;
- Pattern black;
- Pattern white;
- GrafPtr thePort;
- } QDGlobals;
-
- typedef struct {
- char *PAPReadBuffer; /* The PAP read buffer */
- long readBufferSize; /* The size of the PAP read buffer in bytes */
- char *PAPWriteBuffer; /* The PAP write buffer */
- long writeBufferSize; /* The size of the PAP write buffer in bytes */
- QDGlobals *qd; /* A pointer to the LWFU's QuickDraw globals */
- /* PAP Routines */
- ProcPtr OpenPrinter; /* Open a connection */
- ProcPtr DoWrite; /* Read from and write to the printer */
- ProcPtr ClosePrinter; /* Close a connection */
- /* Dialog utilities */
- ProcPtr CenterDialog; /* Center dialogs on main screen */
- ProcPtr PositionAlert; /* Correctly position alerts on main screen */
- ProcPtr UseCursor; /* Install a cursor from a CURS resource */
- ProcPtr GetPText; /* Copy text of dialog item into Pascal string */
- ProcPtr SetPText; /* Put given Pascal string into a dialog item */
- ProcPtr GetNumText; /* Get a number from a dialog text item */
- ProcPtr SetNumText; /* Put a number into a dialog text item */
- ProcPtr GetValue; /* Return the value of a control dialog item */
- ProcPtr SetValue; /* Set the value of a control dialog item */
- ProcPtr EnCtrl; /* Enable a specified control dialog item */
- ProcPtr DisCtrl; /* Disable a specified control dialog item */
- ProcPtr SetControlPName; /* Set a control’s title from a Pascal string */
- ProcPtr FullSel; /* Select all the text in a given editText item */
- ProcPtr InvalItem; /* Invalidate the bounds of a dialog item */
- ProcPtr UserItem; /* Install a userItem procedure */
- ProcPtr GrayLineItem; /* Dialog userItem to draw gray lines */
- ProcPtr BoldOutlineItem; /* Dialog userItem to outline a default button */
- ProcPtr RectItem; /* Dialog userItem to draw a box */
- /* String utilities */
- ProcPtr Pstrcat; /* Concatenate one Pascal string to another */
- ProcPtr Pstrcpy; /* Copy one Pascal string to another */
- ProcPtr GetAndAppend; /* Append a string from a STR# to a string */
- ProcPtr ConvertAndAppend; /* Convert convert to ASCII and append a number */
- } LWFUCallBackInfo;
-
- typedef struct {
- short version; /* The version of this record (1) */
- short resSpace; /* The first ID in this UTIL's resource space */
- long uStorage; /* put a handle to UTIL private storage here */
- LWFUDriverInfo *driverInfo; /* Info about the current printer driver */
- LWFUPrinterInfo *printerInfo; /* Info about the current printer */
- LWFUCallBackInfo *callBacks; /* Buffers and callbacks into the LWFU */
- } LWFUParmBlk;
-
- typedef struct {
- short version; /* The version of this resource */
- short resSpace; /* The first ID in this UTIL's resource space */
- long Utility_Open; /* The offset to the Open routine */
- long Utility_Delta; /* The offset to the Delta routine */
- long Utility_Prime; /* The offset to the Prime routine */
- long Utility_Close; /* The offset to the Close routine */
- /* char Data; */ /* The code */
- } UTILRec, *UTILPtr, **UTILHdl;
-
- typedef pascal short UTILBufferRoutine(short length,LWFUParmBlk *pb);
-